﻿CREATE XML SCHEMA COLLECTION [dbo].[BusinessEventsTypes]
    AS N'<?xml version="1.0" encoding="utf-16" ?>
<xs:schema id="BusinessEventsTypes"
                  targetNamespace="urn:www-vecozo-com:types:events:v2"
                  elementFormDefault="qualified"
                  xmlns="urn:www-vecozo-com:types:events:v2"
                  xmlns:xs="http://www.w3.org/2001/XMLSchema">

        <xs:complexType name="GenericEvents">
                <xs:sequence>
                        <xs:element name="Item" type="GenericEvent" minOccurs="0" maxOccurs="unbounded" nillable="true" />
                </xs:sequence>
        </xs:complexType>

        <xs:complexType name="GenericEvent">
                <xs:sequence>
                        <xs:element name="Name" minOccurs="1" maxOccurs="1" nillable="false" type="xs:string" />
                        <xs:element name="Sender" minOccurs="1" maxOccurs="1" nillable="false" type="xs:string" />
                        <xs:element name="Arguments" minOccurs="0" maxOccurs="1" nillable="true" type="GenericArguments" />
                </xs:sequence>
        </xs:complexType>

        <xs:complexType name="GenericArguments">
                <xs:sequence>
                        <xs:element name="Item" type="GenericArgument" minOccurs="0" maxOccurs="unbounded" nillable="true" />
                </xs:sequence>
        </xs:complexType>

        <xs:complexType name="GenericArgument">
                <xs:sequence>
                        <xs:element name="Key" type="xs:string" minOccurs="1" maxOccurs="1" nillable="false" />
                        <xs:element name="Value" type="xs:string" minOccurs="0" maxOccurs="1" nillable="true" />
                </xs:sequence>
        </xs:complexType>

        <xs:simpleType name="EventId">
                <xs:annotation>
                        <xs:documentation xml:lang="en">
                        </xs:documentation>
                </xs:annotation>
                <xs:restriction base="xs:string">
                        <xs:pattern value="\{[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}\}"/>
                </xs:restriction>
        </xs:simpleType>

</xs:schema>
'